<include file="Admin:header" />

<table  class="search_table print_hide" width="100%">
	<tr>
		<td class="search">
			<form action="{:U($module_name.'/index')}" method="get" name="index_from" id="index_from">
			<input type="hidden" name="g" id="g" value="{$Think.GROUP_NAME}" />
			<input type="hidden" name="m" id="m" value="{$Think.MODULE_NAME}" />
			<input type="hidden" name="a" id="a" value="{$Think.ACTION_NAME}" />

			<input id="title" type="text" class="input-text" name="keyword" value="{$Think.get.keyword}" />
			<select name="searchtype">
			<option value="title" <eq name="searchtype" value='title'>selected="selected"</eq>>客户名称</option>
			<option value="addressee" <eq name="searchtype" value='addressee'>selected="selected"</eq>>收件人</option>
			<option value="tel" <eq name="searchtype" value='tel'>selected="selected"</eq>>联系电话</option>
			<option value="email" <eq name="searchtype" value='email'>selected="selected"</eq>>电子邮箱</option>
			<option value="zipcode" <eq name="searchtype" value='zipcode'>selected="selected"</eq>>邮政编码</option>
			<option value="address" <eq name="searchtype" value='address'>selected="selected"</eq>>联系地址</option>
			<option value="superintendent" <eq name="searchtype" value='superintendent'>selected="selected"</eq>>负责人</option>
			<option value="groupname" <eq name="searchtype" value='groupname'>selected="selected"</eq>>分组名称</option>
			<option value="groupid" <eq name="searchtype" value='groupid'>selected="selected"</eq>>分组id</option>
			<option value="id" <eq name="searchtype" value='id'>selected="selected"</eq>>ID</option>
			</select>

			<select name="sort">
				<option value="asc" <if condition="$sort =='asc'">selected="selected"</if>>{:L('order_by_asc')}</option>
				<option value="desc" <if condition="$sort =='desc'">selected="selected"</if>>{:L('order_by_desc')}</option>
			</select>

			<select name="listRows">
				<option value="15" <if condition="$listRows ==5">selected="selected"</if>>15{:L('listRows')}</option>
				<option value="20" <if condition="$listRows ==20">selected="selected"</if>>20{:L('listRows')}</option>
				<option value="50" <if condition="$listRows ==50">selected="selected"</if>>50{:L('listRows')}</option>
				<option value="100" <if condition="$listRows ==100">selected="selected"</if>>100{:L('listRows')}</option>
			</select>

			<input type="hidden" id="menuid" name="menuid" value="{$_GET['menuid']}"/>
			<input type="submit" value="{:L('chaxun')}"  class="button" onclick="$('#a').val('index');" />
			<input type="reset" value="{:L('reset')}" class="button tophide"  />
			<input type="button" value="导入" class="button tophide" onclick="mo_import();" />
			<input type="button" value="导出" class="button tophide" onclick="mo_export()" />
			<input type="button" value="打印" class="button" onclick="mo_print()" />
			</form>
		</td>

	</tr>
</table>
<form name="myform" id="myform" action="" method="post">
<div class="table-list">
    <table width="100%" cellspacing="0" id="print_content">
		<thead>
            <tr>
			<th width="30" class="print_hide tophide"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
            <th width="30">ID</th>
			<th width="100">客户名称</th>
			<th width="100">收件人</th>
			<th width="120">联系电话</th>
			<th width="120">电子邮箱</th>
			<th width="120">邮政编码</th>
			<th width="120">联系地址</th>
			<th width="100">负责人</th>
			<th width="120">分组名称</th>
			<th width="50">分组id</th>
            <th width="80" class="print_hide tophide">{:L('createtime')}</th>
			<th width="72" class="print_hide tophide">{:L('manage')}</th>
            </tr>
        </thead>
      	<tbody>
      		<volist name="list" id="vo" key="k">
      		<tr>
			<td align="center" class="print_hide tophide"><input class="inputcheckbox " name="ids[]" value="{$vo['id']}" type="checkbox" ></td>
			<td align="center">{$vo['id']}</td>
      		<td align="center">{$vo['title']} </td>
      		<td align="center">{$vo['addressee']} </td>
      		<td align="center">{$vo['tel']} </td>
      		<td align="center">{$vo['email']} </td>
      		<td align="center">{$vo['zipcode']} </td>
      		<td align="center">{$vo['address']} </td>
      		<td align="center">{$vo['superintendent']} </td>
      		<td align="center">{$vo['groupname']} </td>
      		<td align="center">{$vo['groupid']} </td>
      		<td align="center" class="print_hide tophide"><a class="dateformat" title="{$vo['createtime']|todate='Y-m-d H:i:s'}">{$vo['createtime']|todate="Y-m-d"}</a></td>
			<td align="center" class="print_hide tophide"><a href="{:U($module_name.'/edit',array(id=>$vo['id']))}">{:L('edit')}</a> | <a href="javascript:confirm_delete('{:U($module_name.'/delete',array(id=>$vo['id']))}')">{:L('delete')}</a></td>
      		</tr>
      		</volist>
      	</tbody>
    </table>
    <div class="btn print_hide tophide"><input type="button" class="button" name="dosubmit" value="<?php echo L('delete')?>" onclick="myform.action='{:U($module_name.'/deleteall')}';return confirm_deleteall()"/></div>
</form></div>
<div id="pages" class="page print_hide">{$page}</div>
<script>
$("#catid").attr("value",'{$catid}');
function confirm_deleteall(){
	art.dialog.confirm("{:L('real_delete')}", function(){ $('#myform').submit();});
}
function mo_import(){
url='?g=Admin&m=Attachment&a=showloadpage&file_limit=50&file_types=xls&file_size=500&moduleid=3&mo_import=1&mo_model=member';
		art.dialog.open(url, {
		title: '导入文件',
		lock: 'true',
		window: 'top',
		width: 600,
		height: 455,
		});
}
function mo_export(){
	$('#print_content').val('export');
	$('#a').val('export');
	$('#index_from')[0].submit();
}
function mo_print(){
		window.open(location.href+'&pdf=1','Print_Window','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no,status=no');
/*
	if(self==top){
		$('.print_hide').hide();
		$('#print_content').show();
		window.print();
		window.close();
	}else{
		window.open(location.href,'Print_Window','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no,status=no');
	}
*/
}
$(document).ready(function(){
	if(self==top){
		$('.tophide').hide();
	}
})
</script>